package com.demoLearn;

import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

/**
 * @description:
 * @author: tutu
 **/
public class fileCopy {
    public static void main(String[] args) {
        /*try (FileInputStream fis = new FileInputStream("D:\\idea_project\\leetcode\\leetcode\\src\\com\\demoLearn\\net_quality_detail.xlsx");
           FileOutputStream fos = new FileOutputStream("D:\\idea_project\\leetcode\\leetcode\\src\\com\\demoLearn\\net_quality_detail2.xlsx")) {
            int len;
            byte[] buffer = new byte[1024];
            while ((len = fis.read(buffer)) > 0) {
                fos.write(buffer, 0, len);
            }
        } catch (IOException e) {
            // ... handle IO exception
        }*/


    try {
          InputStream resourceAsStreamold = new FileInputStream(new File("D:\\\\idea_project\\\\leetcode\\\\leetcode\\\\src\\\\com\\\\demoLearn\\\\net_quality_detail.xlsx"));
          OutputStream OutputStream=new FileOutputStream(new File("D:\\\\idea_project\\\\leetcode\\\\leetcode\\\\src\\\\com\\\\demoLearn\\\\net_quality_detail2.xlsx"));
          BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(resourceAsStreamold));
          BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(OutputStream));
          StringBuffer stringBuffer=new StringBuffer();
          try {
              String line;
              boolean flag=true;
             while ((line = bufferedReader.readLine()) != null) {
                  // ... do something with line
                 stringBuffer.append(line);
                 System.out.println("shitutuya:"+line);
              }
             System.out.println("shitutuya2:"+new StringBuffer().toString());
              bufferedWriter.write(stringBuffer.toString());
          } catch (IOException e) {
              // ... handle IO exception
          }finally {

          }
      }catch (Exception e){

      }

    }
}
